home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
676-700
/
677
/
mostra
/
mostra.doc
< prev
next >
Wrap
Text File
|
1995-03-18
|
17KB
|
375 lines
Mostra 1.07
A Universal IFF Viewer
© 1990,1991,1992 Sebastiano Vigna
There are many utilities for viewing IFF ILBM files, but none I'd seen until
now met the goal of displaying every IFF picture; each had its
idiosyncrasies. If one viewer could display overscan pictures, then every
picture with more than 640 pixels on a line would be shifted like there were
700 pixels; some programs could only show a directory of pictures by forcing
the user to enter all the filenames; some programs would crash with PAL
pictures; others would do the same with pictures larger than any screen; it
was rare to have an option to force a screen mode (for the tech-folks out
there: old IFF ILBM files don't have the CAMG chunk!); there were no
comfortable file requesters for use when you didn't know the exact name of
the file (who can remember GRABBiT file names?); pressing the right mouse
button could cause a useless drag bar to corrupt the picture...
If a program had one feature, it lacked another, so I decided to write a
show utility. I never would have succeeded without the best friend of an
Amiga programmer: the ARP library. If I have been able to write Mostra, it's
only to ARP's credit. Pattern matching, resource tracking, powerful resident
functions... The only drawback is that you MUST have the arp.library (V39!)
in your libs: directory in order to run Mostra. Otherwise, a message will be
displayed, and Mostra will refuse to run. However, the next release of
Mostra will work only under Release 2 and will not need arp.library. Mostra
is a pure program, i.e., it can be made resident.
Note that you can run Mostra from Workbench: called by itself it will pop
the file requester and will show you pictures until you select CANCEL or
close the file requester window. Otherwise, you can select multiple icons,
or you can change the default tool of your pictures. Note that if you do
this with an IFF CAT or LIST you will have an automatic little slideshow.
Mostra can process *any* IFF ILBM file; this means not only IFF ILBM FORMs,
but also nested ILBM, FTXT, FORMs, CATs, LISTs and PROPs! It will always
try to find the screen type that fits the best, and won't give up if you
want to see 1x1 brushes or VERY large pictures: Tom tried up to 5120x4096
(thanks Tom). In any case, you can force the screen type with several
options.
One of the major features in this release is support for multi-palette
pictures, i.e., pictures with the new PCHG chunk which should substitute the
old CTBL and SHAM chunks. See the Changes.doc file for additional
informations. SHAM is still supported, but the support of CTBL pictures via
external call has been dropped since it was shown to be unreliable.
To get the syntax in AmigaDOS style type:
M ?
This will produce the input template:
Files/...,A=All/S,R=Repeat/S,Q=Quiet/S,NoFastDraw/S,
C=Center/S,B=BlackBackground/S,W=Width/K,H=Height/K,Cycle/S,
Secs/K,Fade/K,NO=NoStartup/S,Batch/K,LockPic/S,
N=NoMouse/S,F=FreeMouse/S,LockKeys/S,NA=NoActivate/S,DB=DoubleBuffering/S,
Hires/S,Lace/S,Lores/S,NoLace/S,HAM/S,Halfbrite/S
If you ask for more help by typing "?" again, you will see:
Mostra 1.06 © 1990,1991,1992 Sebastiano Vigna
Usage: M <wildcards [...] | !> [All] [Repeat] [Quiet] [NoFastDraw]
[Center] [BlackBackground] [Width n] [Height n] [Cycle]
[Secs time] [Fade speed] [NoStartup] [Batch file] [LockPic]
[NoMouse] [FreeMouse] [LockKeys] [NoActivate] [DoubleBuffering]
[Hires | Lores] [Lace | NoLace] [HAM | Halfbrite]
The same help is displayed if you call Mostra with no arguments.
Mostra's first argument is a list of patterns (or file names) as long as you
want; you will get every picture whose name matches one of the patterns.
Alternatively, you can type only the "!" character, and Mostra will display
the famous Heath File Requester, allowing you to scan the entire file system.
When you're tired of looking at the picture, move the mouse pointer to the
very top of the screen and press the right button (you can also press the
RETURN, SPACE or ESCAPE keys). You can drag or depth- arrange the screen
with the left mouse button (the gadgets are invisible, but they really are
there!). TAB will toggle on/off color cycling. To stop pattern matching or
IFF scanning use CTRL-C at any moment.
If the screen size is less than the size of the picture, you can move around
with cursor keys by themselves (moving by 8 pixels) or in combination with
the SHIFT (a screenful minus 16 pixels), ALT (which brings you to the
borders) or CTRL (16 pixels) keys. A noteworthy feature of Mostra is that
the picture is NOT decrunched all at one time in a very large chunk of
memory; instead, a fast ML routine decrunches the file in real-time every
time you move (the routine could be faster, but it has lots of controls to
get rid of damaged IFF BODY chunks; safety always first). This is not as
fast as the memory-eating method, but I think it's MUCH better! Very large
pictures (like 800x900) will be shown in a full screen (generated on the fly
at Workbench size) which you can move around. Overscan pictures will retain
their size of it's not greater than 362x283 lo-res pixels (362x241 on a NTSC
Amiga). For hi-res pictures, there is also a 704 pixel width limit due to
Intuition (724 under Release 2). Small brushes will be shown in a minimum
256x128 pixel screen. Of course, moving vertically with multi-palette
pictures involves a high system overhead, since CopperLists are continuously
built and deleted.
A weird effect of this method is that you can see pictures that can't even
be *LOADED* into your Amiga. Let's suppose you have a really crunched
picture; the BODY chunk and a 256x256 lo-res screen could take much less
space than the decrunched picture, so you could create pictures that only
Mostra could let you see in all of their parts. Why you would want to do
this, well, that's another matter.
Then we have a lot of options (parentheses show how to shorten 'em):
- ALL (A) recursively scans all of the subdirectories during the
wildcard search.
- REPEAT (R) will endlessly restart from the first pattern when it
has finished with the last; if you used the "!" line arguments,
the file requester will pop up after every picture until you
CANCEL or close.
- QUIET (Q) turns off all messages except in case of error.
- NOFASTDRAW leaves the program at priority 0; by default, Mostra
will surround the BODY decrunching operations with a
SetTaskPri(1). This will not lock the system, but in a
multitasking situation Mostra will perform quickly when needed.
- CENTER (C) will force the screen to be centered (640x200 pictures
on PAL screens look so ugly...) and will use overscan if
necessary.
- BLACKBACKGROUND (B) will create a 0-bitplane (almost no memory
consumed!) black screen that will stay until you saw the last
picture. This is for aesthetic purposes only.
- WIDTH and HEIGHT (W,H) want an argument that specifies the
dimensions of the viewing screen. However, Mostra is an
intelligent program, and will almost always find the correct
screen by itself. WARNING: dimensions allowed are from 64 to
1024, at your own risk. Your Amiga won't crash, but weird things
can happen...
- CYCLE will automatically activate color cycling on every picture.
Usually this happens only by request, through TAB.
- SECS must be followed by a number between 0 and 1000 (the zero
delay was a request from a BIXen). Mostra will display the
picture for the number of seconds specified, but you can skip it
with mouse, RETURN, SPACE, and ESCAPE keys as always or stop the
show with CTRL-C. Cursor keys are disabled. Greatly reworked on
Warren's request.
- FADE lets you specify a speed for pictures to FADE in and out.
Valid numbers are 1 to 4, with four the slowest. Note that HAM
pictures can't be faded.
- NOMOUSE (N) will hide the mouse pointer while Mostra is displaying
a picture.
- FREEMOUSE (F) will let you pass from one picture to another by
clicking either of the mouse buttons at any position on the
screen.
- LOCKKEYS will discard any input from the keyboard during the
display. You must use the mouse to pass to the following picture.
Note that if FREEMOUSE is not activated, the only way to go is
clicking the right mouse button while the mouse pointer is at the top
of the screen.
- LOCKPIC will lock the picture displayed. You won't be able to
scroll around, but the memory in which the file is loaded will be
immediately freed after the decompression, thus minimizing the memory
usage.
- NOACTIVATE (NA) will inhibit the activation of the picture
screens, so you can keep on typing on your current screen. This
was a request from Tom.
- DOUBLEBUFFERING (DB) sets a double buffering show mode: while a
new picture is being loaded you see the old one, no Workbench
pop-up or black screens. Eats lots of memory, too. Again, a
request from Tom. (Note: it's canceled if you call the file
requester.)
Centering is no longer performed via Preferences, so if you move the screen
the centering will go away. NOSTARTUP and BATCH options will be discussed
later.
Now, the graphics options. You can force all screens to be HIRES or LORES,
LACE or NOLACE, HAM or HALFBRITE. Note that if Mostra finds a six bitplane
picture with no indications (no CAMG chunk), it won't set the HAM flag by
default. These flags are "dumb," that is, they'll do exactly what you say,
even if it is meaningless. However, if you use both HALFBRITE and HAM
together, only the former will take place.
And now, some examples:
M MyPics:* SECS 5 FADE 1 NOMOUSE BLACKBACKGROUND REPEAT CENTER ALL
will generate a real (and endless!) slide show of the pictures in the
MyPics: dir and in all its subdirs, centered and with no mouse pointer
hanging around. In order to stop the slide show, you must press CTRL-C.
M df0:*.image df0:pictures/*.pic HIRES LACE
will show the files ending with .image on the drive df0: and the files
ending with .pic in the directory df0:pictures. Mostra will be forced to use
high resolution, interlaced screens. Setting the HIRES flag on pictures with
more than 4 bitplanes usually leads you to see absolutely nothing.
M dh0:hirespic LORES NOLACE
will show a hi-res picture in lo-res ("zooming in"). You can move around
with the cursor keys as described above.
WIDTH and HEIGHT can be useful when you have a picture that cannot be
displayed because there's not enough Chip RAM (you get the "Can't open
Screen" error message). In such a case, try:
M pic WIDTH 128 HEIGHT 128
This will usually allow you to at least get a peek at something.
Advanced features
For maximum flexibility, Mostra allows you to use "startup" files and
"startup" ToolTypes, with which you can configure the program to suit your
tastes.
There is a standard startup file, called S:Startup-Mostra. Mostra will
search for it when run from CLI. The format of this file is *EXACTLY* the
same as the Mostra line format minus the command name ("M"). Commands may be
spread out over several lines or gathered together onto a single line. Every
switch or keyword in the startup file will act as a default, and will be
toggled or superseded by any command line arguments. Command line switches
will act as toggles (if your startup file has the keyword ALL and you say "M
* ALL", you *WON'T* go into subdirectories), while keywords simply assert
the new value (if you have "fade 1" in your startup file and you say "fade
3" in the command line, your pictures will be faded at speed 3).
Two options concern startup files:
- NOSTARTUP inhibit the search for startup files, useful if you have
one of them and you want to specify your options from scratch; it
can be shortened with "NO".
- BATCH wants a complete path/filename that Mostra will use as
startup file.
From the WB side, you can write the startup options in the ToolTypes of the
Mostra icon, and it will use them. The format is the same of Startup-Mostra.
Please note that "FADE=1", "WIDTH=352" are valid, but "FREEMOUSE=ON" is not;
use only "FREEMOUSE".
Or you can set the first ToolType of a project icon to STARTUP and put your
options in the following lines; the project picture file will be shown with
those options when you double-click its icon. You can do the same thing with
an icon that has no related file, and put some wildcards in the ToolType.
The wildcards will then be shown with those options. If you don't put in
wildcards, you get a "style" icon: you can SHIFT click some icons, SHIFT
click the "style" icon (in *THIS* order) and then SHIFT double-click the
Mostra icon (or directly SHIFT double-click the last icon, if its default
tool is Mostra): you will see the selected picture files with the options
specified in the style icon. The style icon by itself will pop up the file
requester. Please note that even an icon with wildcards can be used as a
style icon because multiple selections supersede wildcards.
I know, it seems a little twisted, but using it you'll find, instead, that
it's the way you'd think.
WARNING: strange interactions can take place. If you have some picture
icons, and you SHIFT click all but one of them and then you SHIFT double
click the last *AND* the last picture icon you clicked had some STARTUP
options, you will see *ALL* of the pictures with those options. Right?
For curious/tech/interested people, here is the exact algorithm:
1) If sm_NumArgs > 1 (the user started Mostra with al least an icon
argument), check if sm_ArgList[1] (the first "real" argument) has ToolTypes
with first ToolType = "STARTUP". If so, scan the whole ToolTypes list like a
command line, accepting mixed commands on a single ToolType as well as
separated commands in separated ToolTypes.
2) If 1) goes wrong, check the Mostra icon ToolTypes, and take them as a
command line. (Note: STARTUP is not requested.)
3) Now, if sm_NumArgs > 1, check every sc_ArgList[i] with i>0 and if there
is a related file (*NOT* a .info file!) generate a list of arguments as if
the user entered them manually, *SUPERSEDING* eventual filenames/wildcards
found in 1) and 2).
Now, examples, by means of common problems:
1) "I have a hundred pictures on my 360M hard disk, and I've organized them
in a few groups. How can I make simple slideshows, with each group separate?"
Simple: Create a project icon for each group, and add a ToolType "STARTUP".
Then add a ToolType like "PICS:Group1/* ALL SECS 5 CENTER" to choose your
options, set the default tool to "C:M" (or wherever you put it) and
double-click (of course, this must be done with every group icon). DON'T
give the icons the same name as a directory, or Mostra will collapse in
confusion.
2) "I want to always see the black screen when I start from WB."
Set a Mostra ToolType to "BLACKBACKGROUND".
3) "I have some pictures. Sometimes I want to see a few of them with a full
screen and no mouse, sometimes with a 128x128 screen, sometimes centered."
Create three "style" icons. Each icon must have as its first ToolType
"STARTUP", and the following ones must be something like "NOMOUSE", "WIDTH
128 HEIGHT 128" and "CENTER". The default tool must be "C:M". When you want
to see in a certain style, SHIFT click the picture icons and *THEN* SHIFT
double-click the style icon you desire.
4) "I'd like to click my pics one at a time, each one with different
options. I'd like also to see them in irregular groups, each picture with
its options."
You need a psycho-analyst, not Mostra.
Acknowledgments
I wish to thank some people, first of all the ARP team for the arp.library
and the SAS team for the best Amiga C compiler. Speed and compactness of
Mostra come from the fabulous 5.10b release. Also I would like to thank the
people that encouraged me someway or helped me to find bugs, in particular
Warren Block, Tom Rokicki, Christopher A. Wichura and Loren Wilton.
If you have access to a TeX system, you can print a copy of the TeX
"Mostra.tex" file that comes with the program. Anyway, if you spent a good
part of your time preparing and printing documents, I'd suggest you to take
a look at AmigaTeX, a wonderful package from Radical Eye Software which is
probably the best implementation of TeX you can find on any computer.
Mostra is © 1990,1991,1992 Sebastiano Vigna and it's freely distributable as
long as all of its files are included in their original form without
additions, deletions, or modifications of any kind, and only a nominal fee
is charged for its distribution. This software is provided "AS IS" without
warranty of any kind, either expressed or implied. By using Mostra, you
agree to accept the entire risk as to the quality and performance of the
program.
Comments, complaints, desiderata are welcome.
Sebastiano Vigna
Via Valparaiso 18
I-20144 Milano MI
BIX: svigna
INTERNET: vigna@imiucca.csi.unimi.it
UUCP:cbmehq!cbmita!sebamiga!seba@cbmvax.cbm.commodore.com
...{uunet|pyramid|rutgers}!cbmvax!cbmehq!cbmita!sebamiga!seba
FIDO: 2:332/607.28